<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/13
  Time: 17:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查询当前库存里面的明细产品模态框</title>
</head>
<body>
        <div class="modal-header">
            <button class="close" data-dismiss="modal">退出</button>
        </div>
        <div class="modal-body">
            <div class="row">
                <div class="col-md-offset-5"><h2>入库单明细</h2></div>
                <br>
                <div class="row">
                    <div class="col-md-6">
                        <table>
                            <tr>
                                <td>入库单编号:</td>
                                <td><input type="text" id="querygatherdetaildsmodalgatherId" style="outline: none;border: none"></td>
                            </tr>
                            <tr>
                                <td>产品名称:</td>
                                <td><input type="text" id="querygatherdetaildsmodalproductName" style="outline: none;border: none"></td>
                            </tr>
                        </table>
                    </div>
                    <div class="col-md-6">
                        <table>
                            <tr>
                                <td>产品编号:</td>
                                <td><input type="text" id="querygatherdetaildsmodalproductId" style="outline: none;border: none"></td>
                            </tr>
                            <tr>
                                <td>成本单价:</td>
                                <td><input type="text" id="querygatherdetaildsmodalamountUnit" style="outline: none;border: none"></td>
                            </tr>
                        </table>
                    </div>
                </div>
                <br>
                <br>
                <br>
                <div style="height:60%">
                    <table id="queryBygahtergatherdateildidshowmodaltab">

                    </table>
                </div>
            </div>
        </div>

        <script>
            //加载数据
            $(function () {
                //获取值
                var productId='${param.productId}'
                var gatherIdqueryshowss='${param.gatherIdqueryshowss}'
                var id='${param.id}'
                var checkTimequeryshow='${param.checkTimequeryshow}'
                //给表格赋值
                $("#queryBygahtergatherdateildidshowmodaltab").bootstrapTable({
                    contentType: "application/x-www-form-urlencoded", //如果用tomcat就要写这个
                    striped: true,//是否显示隔行变色
                    cache: false,//是否缓存
                    pagination: false,//是否显示分页
                    sortable: false,//是否显示排序
                    clickToSelect: true,//是否启用点击选中行
                    uniqueId:"id",//每一行的唯一标识，一般为主键列,
                    columns:[
                        {
                            field:"",
                            title:"序号",
                            formatter:function (value,row,index) {
                                return Number(index+1)
                            },
                        },
                        {
                            field:"checkTime",
                            title:"入库时间"
                        },
                        {
                            field:"amount",
                            title:"本次入库数量"
                        },
                        {
                            field:"subtotal",
                            title:"本次入库成本"
                        },
                    ]
                })
                //赋值给后端查询数据

                $.post("querygatherDetailsBycpidByid.action",{"productId":productId,"id":id},function (data) {
                    //赋值
                    $("#querygatherdetaildsmodalgatherId").val(gatherIdqueryshowss)
                   $("#querygatherdetaildsmodalproductName").val(data.productName)
                    $("#querygatherdetaildsmodalproductId").val(data.productId)
                    $("#querygatherdetaildsmodalamountUnit").val(data.amountUnit)
                    var arr=[{
                        "checkTime":checkTimequeryshow,
                        "amount":data.amount,
                        "subtotal":data.subtotal
                    }]
                    $("#queryBygahtergatherdateildidshowmodaltab").bootstrapTable("load",arr);
                },"json")

            })
        </script>
</body>
</html>
